package com.jinghua.treatment.controller;

import com.jinghua.treatment.entity.SysAndrology;
import com.jinghua.treatment.service.SysAndrologyService;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * 男科情况控制器
 * Created by 王兴光 on 2018/3/26.
 */
@Controller
@RequestMapping("/andrology")
public class SysAndrologyController {

    @Resource
    private SysAndrologyService andrologyService;

    @ApiOperation(value="根据男科情况编号查询男科情况信息")
    @GetMapping(value="/getAndrologyById",params = {"andrologyId"})
    @ResponseBody
    public SysAndrology findAndrologyById(Integer andrologyId){return andrologyService.selectByPrimaryKey(andrologyId);};

    @ApiOperation(value="新增男科情况信息")
    @GetMapping(value="/insertAndrology")
    @ResponseBody
    public int insertAndrology(SysAndrology andrology){return andrologyService.insert(andrology);};

    @ApiOperation(value="更新男科情况信息")
    @GetMapping(value="/updateAndrology")
    @ResponseBody
    public int updateAndrology(SysAndrology andrology){return andrologyService.updateByPrimaryKey(andrology);};
}
